<template>
  <div>
    <span v-for="(item, index) in list" :key="index">
      <input type="checkbox" v-model="value" :value="item">{{ item }}
    </span>
    <div>你选中的元素累加和为：{{ sum }}</div>
  </div>
</template>

<script>
export default {
  data () {
    return {
      list: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      value: []
    }
  },
  computed: {
    sum () {
      return this.value.reduce((price, item) => price += item,0)
    }
  }
}
</script>

<style>

</style>